package com.foreknow.homework;

import java.util.Scanner;

public class Computer {
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String name(int a) {
        switch (a) {
            case 1:
                this.name = "刘备";
                break;
            case 2:
                this.name = "孙权";
                break;
            case 3:
                this.name = "曹操";

        }
        return this.name;
    }
    public String chuquan(){
        String jieguo = "";
        int a =(int) ((Math.random() * 9 + 1) );
        if (a<=3){
            jieguo = "剪刀";
        }else if (a>3 && a<=6){
            jieguo = "石头";
        }else {
            jieguo = "布";
        }return jieguo;
    }
}
